package com.zhengjiang.pattern.demo.observer;

public class MessageCenter {

    public static void main(String[] args) {
        Observer customerA = new CustomerA();
        Observer customerB = new CustomerB();
        MessageNotice messageNotice =  new MessageNotice();
        messageNotice.addObserver(customerA);
        messageNotice.addObserver(customerB);
        messageNotice.notifyObserver("The newest style on sell!");

        messageNotice.delObserver(customerB);
        messageNotice.notifyObserver("sell off!");
    }
}
